import request from '@/utils/request'
import { status } from 'nprogress'

const api_name = '/admin/hosp/hospitalSet'

export default {

    //获取医院设置列表
    getHospSetList(page, limit, searchObj) {
        return request({
            url: `${api_name}/findHospitalSetPage/${page}/${limit}`,
            method: 'post',
            //params: searchObj
            data: searchObj  //使用json
        })
    },
    //根据ID进行医院设置删除
    deleteHospitalSet(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    },
    //批量删除医院设置
    removeHospitalSet(idList) {
        return request({
            url: `${api_name}/removeByIds`,
            method: 'post',
            data: idList
        })
    },
    //根据id锁定和解锁医院设置
    lockHospitalSet(id, status) {
        return request({
            url: `${api_name}/lockHospitalSet/${id}/${status}`,
            method: 'post'
        })
    },
    //根据id查询医院设置
    selectidHospitalSet(id){
        return request({
            url: `${api_name}/selectidHospitalSet/${id}`,
            method: 'get'
        })
    },
    //添加医院设置
    saveHospitalSet(hospitalSet){
        return request({
            url: `${api_name}/AddHospitalSet`,
            method: 'post',
            data: hospitalSet
        })
    },
    //修改医院设置
    updateHospitalSet(hospitalSet){
        return request({
            url: `${api_name}/updateHospitalSet`,
            method: 'post',
            data: hospitalSet
        })
    }
}
